/* 
 * File:   main.cpp
 * Author: Nguyen Minh Tan
 *
 * Created on June 1, 2009, 1:34 AM
 */

#include <stdlib.h>
#include <iostream>
using namespace std;
/*
 * 
 */
struct MyTest{
    int one;
    MyTest(){
        one =1 ;
    }
    MyTest(const MyTest& test){
        this->one = 15;
    }
    MyTest& operator=(const MyTest& test){
        this->one = 30;
        return *this;
    }
};
int main(int argc, char** argv) {
    MyTest test1;
    MyTest test2(test1);//Su? dung. copy constructor copy gia' tri. tu` doi' tuong. test1 sang test2 (Neu' ko xay dung. ham` nay` se~ su? dung. ham` mac dinh)
    MyTest test3;
    test3 = test2;//Su? dung. gan' copy gia' tri. tu` doi' tuong. test2 sang test3 (Neu' ko xay dung. ham` nay` se~ su? dung. toan' tu? gan' default)
    cout << test1.one << endl;
    cout << test2.one << endl;
    cout << test3.one << endl;
}
/*
1
15
30
*/
